package com.maoye.ossp.sys.base.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hotent.base.db.api.IdGenerator;
import com.maoye.ossp.common.web.BaseController;
import com.maoye.ossp.sys.base.entity.SysBaseTaxRate;
import com.maoye.ossp.sys.base.entity.SysDict;
import com.maoye.ossp.sys.base.service.SysBaseTaxRateService;

/**
 * 税票税率控制器
 * @author yangh
 *
 */
@Controller
@RequestMapping(value = "/sys/base/sysBaseTaxRate")
public class SysBaseTaxRateController extends BaseController {
	@Resource
	private SysBaseTaxRateService service;
	@Resource
	IdGenerator idGenerator;
	
	@RequestMapping(value = "save")
	public String save(SysBaseTaxRate sysBaseTaxRate){
		sysBaseTaxRate.setId(idGenerator.getUId());			
		service.create(sysBaseTaxRate);
		return "redirect:/sys/base/sysBaseTaxRate/list";
	}
	@RequestMapping(value = "list")
	public String list(Model model){			
		List<SysBaseTaxRate> list = service.getAll();
		model.addAttribute("list", list);
		return "/sys/base/taxRate/list";
	}
	
	@RequestMapping(value = "add")
	public String add(Model model,HttpServletRequest request,SysBaseTaxRate sysBaseTaxRate, HttpServletResponse response){
		model.addAttribute("sysBaseTaxRate", sysBaseTaxRate);
		return "/sys/base/taxRate/add";
	}
}
